import pygame
pygame.init()
screen = pygame.display.set_mode((1280,720))
clock = pygame.time.Clock()
running = True

while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
        else:
            print(event)
    
    # 屏幕填充颜色
    screen.fill("blue")
    
    # 刷新屏幕
    pygame.display.flip()
    clock.tick(30)  # 限制fps 30帧

pygame.quit()

'''事件
按下 j
<Event(768-KeyDown {'unicode': 'j', 'key': 106, 'mod': 4096, 'scancode': 13, 'window': None})>
<Event(771-TextInput {'text': 'j', 'window': None})>
<Event(769-KeyUp {'unicode': 'j', 'key': 106, 'mod': 4096, 'scancode': 13, 'window': None})>

左键
<Event(1025-MouseButtonDown {'pos': (473, 296), 'button': 1, 'touch': False, 'window': None})>
<Event(1026-MouseButtonUp {'pos': (473, 296), 'button': 1, 'touch': False, 'window': None})>

中键
<Event(1025-MouseButtonDown {'pos': (473, 296), 'button': 2, 'touch': False, 'window': None})>
<Event(1026-MouseButtonUp {'pos': (473, 296), 'button': 2, 'touch': False, 'window': None})>

右键
<Event(1025-MouseButtonDown {'pos': (408, 309), 'button': 3, 'touch': False, 'window': None})>
<Event(1026-MouseButtonUp {'pos': (408, 309), 'button': 3, 'touch': False, 'window': None})>

鼠标移动
<Event(1024-MouseMotion {'pos': (407, 312), 'rel': (-1, 3), 'buttons': (0, 0, 0), 'touch': False, 'window': None})>
<Event(1024-MouseMotion {'pos': (397, 321), 'rel': (-10, 9), 'buttons': (0, 0, 0), 'touch': False, 'window': None})>
'''